﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Generator
{
    /// <summary>
    /// An abstract definition of a value generator.
    /// </summary>
    [Serializable]
    public abstract class AbstractGenerator
    {
        /// <summary>
        /// The current base value of the generator.
        /// </summary>
        protected double currentValue;

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractGenerator"/> class.
        /// </summary>
        protected AbstractGenerator()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractGenerator"/> class.
        /// </summary>
        /// <param name="startvalue">The start value of the generator.</param>
        protected AbstractGenerator(double startvalue)
        {
            this.currentValue = startvalue;
        }

        /// <summary>
        /// Calculates the next value by using its specification.
        /// </summary>
        /// <returns>The calculated value of the generator.</returns>
        public abstract double NextValue();
    }
}